/*
 * SessionManager.h
 *
 *  Created on: Sep 13, 2012
 *      Author: shawnmao
 */

#ifndef SESSIONMANAGER_H_
#define SESSIONMANAGER_H_

#include "TcpServerSession.h"
#include "TcpClientSession.h"
#include "Common.h"

class SessionManager
{
public:
	int add_srv_session(uint8_t index, TcpServerSession* srv_session_ptr);
	int add_cli_session(uint8_t index, TcpClientSession* cli_session_ptr);

	int start_srv_session(uint8_t index);
	int start_cli_session(uint8_t index);

	int close_srv_session(uint8_t index);
	int close_cli_session(uint8_t index);

private:
	map< uint8_t, pair<pthread_t, TcpServerSession*> > m_srv_session_map;
	map< uint8_t, pair<pthread_t, TcpClientSession*> > m_cli_session_map;
};


#endif /* SESSIONMANAGER_H_ */
